
import Vue from 'vue'

import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
        lpage: [],
        rpage: [],
        nmodule:[]
    },
    getters: {

    },
    mutations: {
        lpagehandle(state, n) {
            for (let i = 0, l = n.length; i < l; i++) {
                Vue.set(state.lpage, i, n[i])
            }
        },
        rpagehandle(state, n) {
            for (let i = 0, l = n.length; i < l; i++) {
                Vue.set(state.rpage, i, n[i])
            }
        },

        nmodule(state, n) {
            for (let i = 0, l = n.length; i < l; i++) {
                Vue.set(state.nmodule, i, n[i])
            }
        }
    },
    actions: {
        changename(context, n) {
            setTimeout(function () {
                context.commit('changename', n)
            }, 2000)
        }
    }
})
export default store
